package com.jy.modules.cims.component.loan;

import java.util.List;
import java.util.Map;

import com.jy.modules.cims.data.common.dto.TCMmQuotaLoanDetailDTO;
import com.jy.modules.cims.data.dto.DealDetailDto;
import com.jy.modules.cims.data.dto.DealDto;
import com.jy.modules.cims.data.dto.ImgurlDto;
import com.jy.modules.cims.data.dto.LoanDto;
import com.jy.modules.cims.data.dto.PlcImagesDto;
import com.jy.modules.cims.data.dto.QuotaLoanDetailDto;
import com.jy.modules.cims.data.dto.QuotaLoanDto;
import com.jy.modules.cims.data.dto.RepayPlanDto;
import com.jy.modules.cims.data.dto.loan.LoanBorrowerAssetDto;
import com.jy.modules.cims.data.dto.loan.LoanBorrowerCreditInfoDto;
import com.jy.modules.cims.data.dto.loan.LoanBorrowerDto;
import com.jy.modules.cims.data.dto.loan.LoanBorrowerEntityDto;
import com.jy.modules.cims.data.dto.loan.LoanBorrowerJobDto;
import com.jy.modules.cims.data.dto.loan.LoanBorrowerLoanInfoDto;
import com.jy.modules.cims.data.dto.loan.LoanDealBaseInfoDto;
import com.jy.modules.cims.data.interact.api.request.RequestLoanRedemptionApplyLoanDTO;

/**
 * 贷款统一处理组件
 */
public interface ICLoan {

	/**
	 * @param detail
	 * @return
	 */
	public LoanDto dealDetailToLoan(DealDetailDto detail);

	/**
	 * @param dto
	 * @return
	 */
	public DealDetailDto loanToDealDetail(LoanDto dto);

	/**
	 * 保存贷款信息
	 * 
	 * @param dto
	 * @return
	 */
	public void saveInfo(LoanDto dto);

	/**
	 * 获得贷款还款计划
	 * 
	 * @param loanTransId
	 * @return
	 */
	public List<RepayPlanDto> getRepayPlan(String loanTransId);

	/**
	 * 
	 * @Title updateTCMmQuotaLoanDetailStatusByTransferIds
	 * @Description 根据进件编号更新交易状态 void
	 * @author lizhiqiang
	 * @date 2015-1-23-下午5:11:06
	 * @update
	 * @throws
	 */
	public void updateTCMmQuotaLoanDetailStatusByContractNos(QuotaLoanDto qldto) throws Exception;

	/**
	 * 根据交易流水号查询贷款明细关联的影像URL登记信息
	 * 
	 * @param dealCode
	 * @return
	 */
	public List<ImgurlDto> searchUploadImgurlByDealCode(String dealCode);

	/**
	 * @description 根据交易流水号查询贷款明细关联的影像URL登记信息
	 * @param dealCode
	 * @return
	 */
	public List<ImgurlDto> searchImgurlBydealCode(String dealCode);

	/**
	 * @description 根据主键更新上传文件状态
	 * @param id
	 * @param fileUploadStatus
	 */
	public void updateImgurlFileUploadStatusById(long id, String fileUploadStatus) throws Exception;

	/**
	 * @description 根据贷款交互状态获取申请流水号
	 * @param loanEachStatus
	 * @return
	 */
	public List<DealDto> getDealCodeByLoanEachStatus(String loanEachStatus) throws Exception;

	/**
	 * @description 根据交易流水号修改贷款交互状态
	 * @param dealCode
	 * @throws Exception
	 */
	public void updateLoanEachStatusByDealCode(String dealCode, String loanEachStatus) throws Exception;

	/**
	 * 
	 * @Title updateLoanEachStatusByContractNos
	 * @Description 根据合同号批量更新贷款交互状态
	 * @author shengzhoutao
	 * @date 2015-4-16-下午5:11:06
	 * @update
	 * @throws
	 */
	public void updateDetailLoanEachStatusByContractNos(String loanEachStatus, String dealCode, String contractNos) throws Exception;

	/**
	 * 根据合同号，产品类型，配置获取需要上传的影像资料
	 * @Description 
	 * @throws
	 * @author zhangmi
	 * @date 2015-11-16
	 */
	public List<ImgurlDto> searchUploadImgurls(String contractNo,String attachNames) throws Exception;
	
	/**
	 * @description 根据申请流水号查询获取记录条数
	 * @param quotaCode
	 * @return
	 */
	public int getQuotaLoanDetailCountByQuotaCode(String quotaCode);

	/**
	 * @description 根据额度申请查询获取额度明细
	 * @param dto
	 * @return
	 */
	public List<QuotaLoanDetailDto> getQuotaLoanDetailByQuotaLoanDetai(QuotaLoanDetailDto dto);

	/**
	 * @description 根据额度申请编号和合同号查询额度申请贷款明细
	 * @param quotaCode
	 * @param contractNoList
	 * @return
	 */
	public List<TCMmQuotaLoanDetailDTO> getQuotaLoanDetailByQuotaCodeAndContractNoList(String quotaCode, List<String> contractNoList);
	
	/**
	 * @Description 批量修改额度额度明细
	 * @author shengzhoutao
	 * @param paramMap
	 * @return
	 */
	public int updateQuotaLoanDetailDealStatus(Map<String, Object> paramMap);
	
	public List<PlcImagesDto> findPlcImagesByCpcAndDealType(Map<String, Object> paramMap);
	
	public List<PlcImagesDto> findPlcImagesByDealCodeContractNo(Map<String, Object> paramMap);

	public List<LoanDealBaseInfoDto> getLoanDealBaseInfoListByPaging(Map<String,Object> paramMap);

	public LoanBorrowerDto getLoanBorrowerInfoByLoanNumber(String loanNumber);

	public List<LoanBorrowerJobDto> getLoanBorrowerJobsByLoanNumber(String loanNumber);

	public LoanBorrowerCreditInfoDto getLoanBorrowerCreditInfoByLoanNumber(String loanNumber);

	public List<LoanBorrowerEntityDto> getLoanBorrowerEntityByLoanNumber(String loanNumber);

	public LoanBorrowerLoanInfoDto getLoanBorrowerLoanInfoByLoanNumber(String loanNumber);

	public List<LoanBorrowerAssetDto> getLoanBorrowerAssetByLoanNumber(String loanNumber);
	/**
	 * 
	 * @Title doReceiveLoanRedemption
	 * @Description TODO
	 * @return 
	 * String 
	 * @author lizhiqiang
	 * @date 2016-12-28-下午6:12:51
	 * @update 
	 * @throws
	 */
	public String doReceiveLoanRedemption(List<RequestLoanRedemptionApplyLoanDTO> loanList) throws Exception;
}